package com.adam.example.newssearches8_2_0.service;

import com.adam.example.newssearches8_2_0.common.Pager;
import com.adam.example.newssearches8_2_0.mapper.NewsMapper;
import com.adam.example.newssearches8_2_0.po.NewsPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NewsService {

    @Autowired
    private NewsMapper newsMapper;

    public List<NewsPO> queryByPage(int pageNo, int pageSize) {
        Pager pager = new Pager(pageNo, pageSize);
        return newsMapper.queryByPage(pager);
    }

    public long queryCount() {
        return newsMapper.queryCount();
    }

}
